ift_mode=0; } } } else { level_ended=1; spcbrk[0]->dtype=BRK_NULL; } } } if(lift_pos>0) { // baddie_pause=1; if(lift_spd<0x40) lift_spd++; } } else { if(lift_pos>0x800) if(lift_spd>1) lift_spd--; } lift_pos+=lift_spd; play_freq(temp_samples[0], 0x1400 + (lift_spd << 2)); if(lift_pos>=0x1000) { lift_pos-=0x1000; lift_floor++; } #ifndef SAT_VER j=( ( ( (lift_pos*0x600)/0x1000) -0x600*2) -0x210 ) <<15; for(i=0;i<4;i++,j+=0x600<<15) { mobs[wall_mob+i].y=j; mobs[wall_mob+i+4].y=j; } #endif set_door_13(); } else if(level==LEVEL_14) { if(sublev==1 && pz_gt(32<<16)) { play_sfx(SMP_EXPLO1,255,0x1800); play_sfx(SMP_L_ALARM1,255,0x1800); sublev=2; alarm_flag=1; alarm_cnt=0; create_fx(OD_EXP_M ,-96<<19,-0x180<<16 ,120<<19); create_fx(OD_EXP_M ,-96<<19,-0x100<<16 ,120<<19); create_fx(OD_EXP_M ,-96<<19,-0x080<<16 ,120<<19); create_fx(OD_BLAST1 ,-96<<19, 0 ,120<<19); create_fx(OD_EXP_M , 96<<19,-0x180<<16 ,120<<19); create_fx(OD_EXP_M , 96<<19,-0x100<<16 ,120<<19); create_fx(OD_EXP_M , 96<<19,-0x080<<16 ,120<<19); create_fx(OD_BLAST1 , 96<<19, 0 ,120<<19); shaker=16; eflash=4; dual_rumble (RFX_SHUDDER); play_sfx(SMP_EXPLO1,192,0x1300); for(i=0;i<16;i++) make_exp_frag_ang(OD_WRECK1+(rand()&3),-96<<19,-(rand()&255)<<16,120<<19, 0x600); for(i=0;i<16;i++) make_exp_frag_ang(OD_WRECK1+(rand()&3), 96<<19,-(rand()&255)<<16,120<<19, 0x200); play_sfx(SMP_EXPLO1,128,0x0e00); baddie_pause=0; } set_alarm_14(); set_door_14(); } else if(level==LEVEL_15) { level_logic_15(); } else if(level==LEVEL_21) { do_21_ambientsound(); } else if(level==LEVEL_22) { set_traffic_lights(); if(game_del > 30*2 && sublev && (game_del&7)==0 ) { for(j=0,k=0,m=&mobs[0];jtype==OD_22POLCEBAR OR m->type==OD_22POLCBAR2) { dual_rumble (RFX_EXP); play_sfx(SMP_EXPLO1,255,0x1800); shaker=16; eflash=4; for(i=0;i<4;i++) make_exp_frag(OD_WRECK1+(rand()&3), m->x, 0, m->z); m->type=OD_NULL; if(++k > 4) break; } } } } else if(level==LEVEL_31) { if (level_ended == 1) { if (door2_pos == 0x30) spcbrk[0]->dtype = BRK_NULL; else door2_pos += 2; } if (baddie_pause == 1) { if (sublev == 0) { if (door_pos) { if (++door_pos == 32) { spcbrk[1]->dtype = BRK_NULL; sublev = 1; } } else if ( pz_gt ( (-475<<19)+(LEV31_ZMOD<<16) ) ) { spcbrk[2]->dtype = BRK_SOLID; door_pos = 1; play_sfx(SMP_EDMOVE, 0xc0, 0x1600); } } else if (sublev == 1) { if ( pz_gt( (0xf628<<16)+(LEV31_ZMOD<<16) ) ) { spcbrk[1]->dtype = BRK_SOLID; door_pos = 0; baddie_pause = 0; sublev = 2; } } else if (sublev == 2) { if (door_pos) { if (++door_pos == 32) { spcbrk[5]->dtype = BRK_NULL; sublev = 3; } } else if (px_lt( (0x780 << 16) )) { spcbrk[6]->dtype = BRK_SOLID; play_sfx(SMP_EDMOVE, 0xc0, 0x1600); door_pos = 1; } } else if (sublev == 3) { if (px_lt(0x420 << 16)) { spcbrk[5]->dtype = BRK_SOLID; door_pos = 0; baddie_pause = 0; sublev = 4; } } else if (sublev == 4) { if (door_pos) { if (++door_pos == 32) { spcbrk[3]->dtype = BRK_NULL; sublev = 5; } } else if (px_lt(-390 << 19)) { spcbrk[4]->dtype = BRK_SOLID; play_sfx(SMP_EDMOVE, 0xc0, 0x1600); temp_samples[0] = play_sfx(SMP_L_MERC, 0x70, 0x1800) + 1; door_pos = 1; } } else if (sublev == 5) { if (px_lt(-465 << 19)) { spcbrk[3]->dtype = BRK_SOLID; door_pos = 0; baddie_pause = 0; sublev = 6; } } } } else if (level == LEVEL_33) { { if (baddie_pause) spcbrk[7]->dtype = BRK_NULL; if (pz_gt(0x07c1 << 16)) sublev++, baddie_pause = 0, spcbrk[4]->dtype = BRK_SOLID; } flag1=flag2=-2; for(i=0;i0) { j=ply[i].pz>>16; // if( (j>-0x1380 && j<-0x0f80) OR (j>0x0780 && j<0x0b80) ) flag1=2; // if( (j>-0x0600 && j<-0x0200) ) flag2=2; if( (j>-0x12ff && j<-0x0f80) OR (j>0x07c1 && j<0x0b80) ) flag1=2; if( (j>-0x059f && j<-0x0200) ) flag2=2; // if( (j>(-0x12ff-0x80) && j<(-0x0f80+0x80) ) OR (j>(0x07c1-0x80) && j<(0x0b80+0x80) ) ) flag1=2; // if( (j>(-0x059f-0x80) && j<(-0x0200+0x80) ) ) flag2=2; } } if(door_pos==0 && flag1>0) sfx_flag=2; if(door_pos==0x40 && flag1<0) sfx_flag=2; door_pos+=flag1; if(door_pos<0) door_pos=0; if(door_pos>0x40) door_pos=0x40; if(door2_pos==0 && flag2>0) sfx_flag=1; if(door2_pos==0x40 && flag2<0) sfx_flag=1; door2_pos+=flag2; if(door2_pos<0) door2_pos=0; if(door2_pos>0x40) door2_pos=0x40; if(sfx_flag) play_sfx(SMP_EDMOVE,255,0x1700); set_door_51(); if(door_pos==0x40) i = BRK_NULL; else i = BRK_SOLID; spcbrk[8]->dtype = spcbrk[10]->dtype = i; if(door2_pos==0x40) i = BRK_NULL; else i = BRK_SOLID; spcbrk[9]->dtype = i; } void level_logic_15(void) { int i,j; if(game_del==30*7) { snd_wind = play_sfx(SMP_L_WIND,128,0x1800); shaker=16; eflash=4; play_sfx(SMP_EXPLO1,255,0x1800); play_sfx(SMP_WINDOW1,255,0x1900); dual_rumble (RFX_EXP); mobs[0].type++; for(i=-168;i>=-168*5;i-=168*2) { create_item_ang(OD_15WINPANE1+(rand()&3),-80<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3),-48<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3),-16<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3), 16<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3), 48<<19, i<<16, 441<<19, 0); create_item_ang(OD_15WINPANE1+(rand()&3), 80<<19, i<<16, 441<<19, 0); } for(i=0;i<96;i++) { j=-96+(rand()&127)+(rand()&63); make_gldot_fx( j<<19 ,( -(rand()&511)-(rand()&255) )<<16 ,441<<19 , (j)&0x7ff ); } for(i=0;i<16;i++) { create_item(OD_15PAPER1+(rand()%3),(-16+(rand()&31))<<19, -0x80<<16, (384+(rand()&15))<<19); } for(i=0;i<16;i++) { j=-96+(rand()&127)+(rand()&63); create_item(OD_15PAPER1+(rand()%3),j<<19,-(rand()&511)<<16, 256<<19); } } if(game_del>30*7) { if((rand()&31)==0) { create_item(OD_15PAPER1+(rand()%3),(-96+(rand()&127)+(rand()&63))<<19,-(rand()&511)<<16, 256<<19); play_sfx(SMP_PAPER1+(rand()&1),255,0x1700+(rand()&0x1ff) ); } } } void levels_logic() { int i,j,k; MOB *m; if(gen_time > 0) gen_time--; if(level==LEVEL_11) { set_11van2_door(); } else if(level==LEVEL_12) { set_door_12(); // update_monitor(); } else if(level==LEVEL_13) { #if DEBUG==1 // if((game_del&63)==0) make_fallglas_fx(0,-0x240<<16,0); #endif if((lift_floor&1)==0) { if(lift_pos==0) { if(lift_mode==0) { lift_spd=0; baddie_pause=1; if (door_pos == 0) play_sfx(SMP_EDMOVE, 0xff, 0x1700), play_sfx(SMP_LIFTBONG, 0xff, 0x1800); if(lift_floor&2) { door_pos++; if(door_pos==32) { baddie_pause=0; lift_mode=1; } } else if(game_del>30*2) { door_pos++; if(door_pos==32) { baddie_pause=0; lift_mode=1; } } } else if(lift_mode==1) { baddie_pause=0; if(baddies_left>0) lift_mode++; } else if(lift_mode==2 && game_del>30*2) { if (door_pos == 30) play_sfx(SMP_EDMOVE, 0xff, 0x1700); for(i=0;i 64<<19) break; } if(elevator_flag==1) { if (i == MAXCHARS) { if (door_pos > 0) door_pos--; } if(baddie_pause==1) { if(door_pos>0) door_pos--; if(door_pos==0) { lift_pos++;